package com.wy2cloud.mybatis;


import com.github.pagehelper.Page;
import com.wy2cloud.core.data.PageResult;

public final class PageTools {

	public static <T> PageResult<T> toPageResult(Page<T> page){
		PageResult<T> pageResult=new PageResult<>();
		pageResult.setPageNum(page.getPageNum());
		pageResult.setPageSize(page.getPageSize());
		pageResult.setPages(page.getPages());
		pageResult.setTotal(page.getTotal());
		pageResult.setList(page.getResult());
		return pageResult;
	}
}
